import axios from 'axios'

//创建axios对象
const Server = axios.create({
    baseURL: "",
    timeout: 3000
})

//请求拦截器和响应拦截器

Server.interceptors.request.use(config => {
    return config;
}, error => {
    return Promise.reject(error);
});

//响应拦截器
Server.interceptors.response.use(response => {
    if(response.status == 200){
        return response.data;
    }
    return response;
}, error => {
    return Promise.reject(error);
});

export default Server
